//
//  ByTitleViewControl.m
//  recordworktool_ios
//
//  Created by mc on 2017/12/20.
//  Copyright © 2017年 ZhangZhanbin. All rights reserved.
//

#import "ByTitleViewControl.h"

@implementation ByTitleViewControl

- (id)init{
    self = [super init];
    if (self) {
        self.layer.cornerRadius = 5;
        self.layer.borderColor = BY_THEME_COLOR.CGColor;
        self.layer.borderWidth = 1;
        
        UILabel *titleLabel = [[UILabel alloc] init];
        [self addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self).offset(0);
            make.bottom.equalTo(self).offset(0);
            make.left.equalTo(self).offset(5);
            make.width.mas_equalTo(@35);
        }];
        titleLabel.text= @"日期";
        titleLabel.textColor = BY_THEME_COLOR;
        titleLabel.font = FONT(14);
        titleLabel.textAlignment = NSTextAlignmentCenter;
        
        UIImageView *imageView = [[UIImageView alloc] init];
        [self addSubview:imageView];
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-10);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(12, 7));
        }
        ];
        imageView.image = [UIImage imageNamed:@"xialajiantou"];
        
        self.titleLabel = titleLabel;
        self.imageView = imageView;
                                  
    }
    return self;
}

@end
